#include<stdio.h>
int main(void)
{
    double fee,kw;
    
    scanf("%lf",&kw);

    if(kw<=50&&kw>=0)
    printf("cost = %.2lf",0.53*kw);
    else if(kw>50){
    fee=26.5+0.58*(kw-50);
    printf("cost = %.2lf",fee);
    }else
    {
        printf("Invalid Value!");
    }
    return 0;

    
    
}